package promentheus

import (
	"github.com/prometheus/common/model"
	time2 "go.didapinche.com/time"
	"time"
)

// Alert 接收prometheus发送的信息
type AlertInfo struct {
	Alerts []*Alert `json:"alerts"`
}

type Alert struct {
	*model.Alert
	Value          string     `json:"value"`
	State          string     `json:"state"`
	StartAlertTime time2.Time `json:"start_alert_time"`
}

type AlertResult struct {
	Status string `json:"status"`
	Data   struct {
		AlertInfos []*AlertItem `json:"alerts"`
	} `json:"data"`
}

// AlertInfo prometheus 接口传递的信息
type AlertItem struct {
	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
	State       string            `json:"state"`
	ActiveAt    time.Time         `json:"activeAt"`
	Value       interface{}       `json:"value"`
}
